# core library public header include file
set(HEADER ${INCROOT}/Core.hpp)

# core library additional include files
set(INC
    ${INCROOT}/Core/Core_types.hpp
    ${INCROOT}/Core/assets/ConfigAsset.hpp
    ${INCROOT}/Core/assets/FontAsset.hpp
    ${INCROOT}/Core/assets/ImageAsset.hpp
    ${INCROOT}/Core/assets/MusicAsset.hpp
    ${INCROOT}/Core/assets/SoundAsset.hpp
    ${INCROOT}/Core/classes/App.hpp
    ${INCROOT}/Core/classes/AssetManager.hpp
    ${INCROOT}/Core/classes/ConfigReader.hpp
    ${INCROOT}/Core/classes/StatManager.hpp
    ${INCROOT}/Core/classes/StateManager.hpp
    ${INCROOT}/Core/interfaces/ILogger.hpp
    ${INCROOT}/Core/interfaces/IState.hpp
    ${INCROOT}/Core/interfaces/TAsset.hpp
    ${INCROOT}/Core/loggers/Log_macros.hpp
    ${INCROOT}/Core/loggers/FatalLogger.hpp
    ${INCROOT}/Core/loggers/FileLogger.hpp
    ${INCROOT}/Core/loggers/ScopeLogger.hpp
    ${INCROOT}/Core/loggers/StringLogger.hpp
    ${INCROOT}/Core/loggers/onullstream
    ${INCROOT}/Core/states/MenuState.hpp
    ${INCROOT}/Core/states/SplashState.hpp
    ${INCROOT}/Core/utils/StringUtil.hpp
)

# core library source files
set(SRC
    ${SRCROOT}/Core/Core_types.cpp
    ${SRCROOT}/Core/assets/ConfigAsset.cpp
    ${SRCROOT}/Core/assets/FontAsset.cpp
    ${SRCROOT}/Core/assets/ImageAsset.cpp
    ${SRCROOT}/Core/assets/MusicAsset.cpp
    ${SRCROOT}/Core/assets/SoundAsset.cpp
    ${SRCROOT}/Core/classes/App.cpp
    ${SRCROOT}/Core/classes/AssetManager.cpp
    ${SRCROOT}/Core/classes/ConfigReader.cpp
    ${SRCROOT}/Core/classes/StatManager.cpp
    ${SRCROOT}/Core/classes/StateManager.cpp
    ${SRCROOT}/Core/interfaces/ILogger.cpp
    ${SRCROOT}/Core/interfaces/IState.cpp
    ${SRCROOT}/Core/loggers/FatalLogger.cpp
    ${SRCROOT}/Core/loggers/FileLogger.cpp
    ${SRCROOT}/Core/loggers/ScopeLogger.cpp
    ${SRCROOT}/Core/loggers/StringLogger.cpp
    ${SRCROOT}/Core/states/MenuState.cpp
    ${SRCROOT}/Core/states/SplashState.cpp
    ${SRCROOT}/Core/utils/StringUtil.cpp
)

# add platform specific sources


# find external SFML libraries
find_package(SFML REQUIRED audio graphics window system)

# add include paths of external libraries
include_directories(${SFML_INCLUDE_DIR})

if(BUILD_SHARED_LIBS)
  # define the gqe-core target
  gqe_add_library(gqe-core
                  HEADER        ${HEADER}
                  HEADER_DIR    ${INCROOT}/Core
                  INCLUDES      ${INC}
                  SOURCES       ${SRC}
                  EXTERNAL_LIBS ${SFML_AUDIO_LIBRARY} ${SFML_GRAPHICS_LIBRARY} ${SFML_WINDOW_LIBRARY} ${SFML_SYSTEM_LIBRARY})
else()
  # define the gqe-core target (for a static build, we use depends to remove LNK4006 and LNK4221 errors with Visual Studio)
  gqe_add_library(gqe-core
                  HEADER        ${HEADER}
                  HEADER_DIR    ${INCROOT}/Core
                  INCLUDES      ${INC}
                  SOURCES       ${SRC}
                  DEPENDS       ${SFML_AUDIO_LIBRARY} ${SFML_GRAPHICS_LIBRARY} ${SFML_WINDOW_LIBRARY} ${SFML_SYSTEM_LIBRARY})
endif()
